<?php
class Xigg_Admin_Node_View extends Sabai_Controller
{
    function _doExecute(&$context)
    {
        $vars = $context->response->getVars();
        $node =& $vars['node'];
        $comment_pages =& $node->paginateComments();
        $comment_page =& $comment_pages->getValidPage(1);
        $trackback_pages =& $node->paginateTrackbacks();
        $trackback_page =& $trackback_pages->getValidPage(1);
        $vote_pages =& $node->paginateVotes();
        $vote_page =& $vote_pages->getValidPage(1);
        $context->response->setVars(array(
                                      'comment_pages'            => $comment_pages,
                                      'comment_objects'          => $comment_page->getEntities(),
                                      'comment_page_requested'   => 1,
                                      'comment_sortby'           => '',
                                      'trackback_pages'          => $trackback_pages,
                                      'trackback_objects'        => $trackback_page->getEntities(),
                                      'trackback_page_requested' => 1,
                                      'trackback_sortby'         => '',
                                      'vote_pages'               => $vote_pages,
                                      'vote_objects'             => $vote_page->getEntities(),
                                      'vote_page_requested'      => 1,
                                      'vote_sortby'              => ''
                                    ));
    }
}